/**
 * 
 */
package org.mhz.sit.util;

/**
 * @author Mahan
 *
 * Time utility class 
 */
public final class TimeUtil
{
    /**
     * Private constructor
     */
    private TimeUtil()
    {
        
    }
    
    /**
     * Pad a string
     *
     * @param aFieldWidth - The field width
     * @param aPadChar - The pad character
     * @param aValue - The value to pad
     * 
     * @return The padded string if padding is in fact needed
     */
    public static String pad(final int aFieldWidth, final char aPadChar, final String aValue)
    {
        final StringBuilder sb = new StringBuilder();
        
        for (int i = aValue.length(); i < aFieldWidth; i++)
        {
            sb.append(aPadChar);
        }
        sb.append(aValue);

        return sb.toString();
    }   
}
